
#ifndef PID_H
#define PID_H

#include "stdint.h"

#define SCALING_FACTOR  16
#define SAMPLE_FREQ 2
extern volatile uint16_t  PV;
extern volatile int16_t SV;
uint8_t kp, ki, kd;
int32_t error;
int32_t dInput;
int32_t ITerm , lastInput;


uint16_t Compute(void);
void SetTunings(uint8_t Kp, uint8_t Ki, uint8_t Kd);
void SetOutputLimits(int16_t Min, int16_t Max);
void Initialize(void);
#endif
